<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\CompanyController;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
// Route::middleware('auth:api')->get('/user', function (Request $request) {
//     return $request->user();
// });

// Route::get('/greeting', function () {

// });
Route::get('/', function()
{
    return response()->json(['message' => 'api-api接口']);
});
//单位管理
Route::prefix('company')->group(function () {
    Route::get('/', [\App\Http\Controllers\CompanyController::class, 'index']);
    Route::get('/getAll', [CompanyController::class, 'getAll']);
    Route::get('/getlist', [CompanyController::class, 'getlist']);
    Route::post('/create', [CompanyController::class, 'create']);
    Route::delete('/delete', [CompanyController::class, 'delete']);
    Route::put('/update', [CompanyController::class, 'update']);
    Route::get('/info', [CompanyController::class, 'info']);
    Route::put('/status', [\App\Http\Controllers\CompanyController::class, 'status']);


});

//用户管理
Route::prefix('user')->group(function () {
    Route::get('/', [\App\Http\Controllers\UserController::class, 'index']);
    Route::get('/getAll', [\App\Http\Controllers\UserController::class, 'getAll']);
    Route::get('/getlist', [\App\Http\Controllers\UserController::class, 'getlist']);
    Route::post('/create', [\App\Http\Controllers\UserController::class, 'create']);
    Route::delete('/delete', [\App\Http\Controllers\UserController::class, 'delete']);
    Route::put('/update', [\App\Http\Controllers\UserController::class, 'update']);
    Route::get('/info', [\App\Http\Controllers\UserController::class, 'info']);
    Route::put('/status', [\App\Http\Controllers\UserController::class, 'status']);
});

//角色管理
Route::prefix('role')->group(function () {
    Route::get('/', [\App\Http\Controllers\RoleController::class, 'index']);
    Route::get('/getAll', [\App\Http\Controllers\RoleController::class, 'getAll']);
    Route::get('/getlist', [\App\Http\Controllers\RoleController::class, 'getlist']);
    Route::post('/create', [\App\Http\Controllers\RoleController::class, 'create']);
    Route::delete('/delete', [\App\Http\Controllers\RoleController::class, 'delete']);
    Route::put('/update', [\App\Http\Controllers\RoleController::class, 'update']);
    Route::get('/info', [\App\Http\Controllers\RoleController::class, 'info']);
    Route::put('/status', [\App\Http\Controllers\RoleController::class, 'status']);
});


//设备管理
Route::prefix('equip')->group(function () {
    Route::get('/', [\App\Http\Controllers\EquipController::class, 'index']);
    Route::get('/getAll', [\App\Http\Controllers\EquipController::class, 'getAll']);
    Route::get('/getlist', [\App\Http\Controllers\EquipController::class, 'getlist']);
    Route::post('/create', [\App\Http\Controllers\EquipController::class, 'create']);
    Route::delete('/delete', [\App\Http\Controllers\EquipController::class, 'delete']);
    Route::put('/update', [\App\Http\Controllers\EquipController::class, 'update']);
    Route::get('/info', [\App\Http\Controllers\EquipController::class, 'info']);
    Route::put('/status', [\App\Http\Controllers\EquipController::class, 'status']);
});
//运行区域管理
Route::prefix('site')->group(function () {
    Route::get('/', [\App\Http\Controllers\SiteController::class, 'index']);
    Route::get('/getAll', [\App\Http\Controllers\SiteController::class, 'getAll']);
    Route::get('/getlist', [\App\Http\Controllers\SiteController::class, 'getlist']);
    Route::post('/create', [\App\Http\Controllers\SiteController::class, 'create']);
    Route::delete('/delete', [\App\Http\Controllers\SiteController::class, 'delete']);
    Route::put('/update', [\App\Http\Controllers\SiteController::class, 'update']);
    Route::get('/info', [\App\Http\Controllers\SiteController::class, 'info']);
    Route::put('/status', [\App\Http\Controllers\SiteController::class, 'status']);
});
//运行区域管理
Route::prefix('project')->group(function () {
    Route::get('/', [\App\Http\Controllers\ProjectController::class, 'index']);
    Route::get('/getAll', [\App\Http\Controllers\ProjectController::class, 'getAll']);
    Route::get('/getlist', [\App\Http\Controllers\ProjectController::class, 'getlist']);
    Route::post('/create', [\App\Http\Controllers\ProjectController::class, 'create']);
    Route::delete('/delete', [\App\Http\Controllers\ProjectController::class, 'delete']);
    Route::put('/update', [\App\Http\Controllers\ProjectController::class, 'update']);
    Route::get('/info', [\App\Http\Controllers\ProjectController::class, 'info']);
    Route::put('/status', [\App\Http\Controllers\ProjectController::class, 'status']);
});
//运行区域管理
Route::prefix('reason')->group(function () {
    Route::get('/', [\App\Http\Controllers\ReasonController::class, 'index']);
    Route::get('/getAll', [\App\Http\Controllers\ReasonController::class, 'getAll']);
    Route::get('/getlist', [\App\Http\Controllers\ReasonController::class, 'getlist']);
    Route::post('/create', [\App\Http\Controllers\ReasonController::class, 'create']);
    Route::delete('/delete', [\App\Http\Controllers\ReasonController::class, 'delete']);
    Route::put('/update', [\App\Http\Controllers\ReasonController::class, 'update']);
    Route::get('/info', [\App\Http\Controllers\ReasonController::class, 'info']);
    Route::put('/status', [\App\Http\Controllers\ReasonController::class, 'status']);
});
//运行区域管理
Route::prefix('point')->group(function () {
    Route::get('/', [\App\Http\Controllers\PointController::class, 'index']);
    Route::get('/getAll', [\App\Http\Controllers\PointController::class, 'getAll']);
    Route::get('/getlist', [\App\Http\Controllers\PointController::class, 'getlist']);
    Route::post('/create', [\App\Http\Controllers\PointController::class, 'create']);
    Route::delete('/delete', [\App\Http\Controllers\PointController::class, 'delete']);
    Route::put('/update', [\App\Http\Controllers\PointController::class, 'update']);
    Route::get('/info', [\App\Http\Controllers\PointController::class, 'info']);
    Route::put('/status', [\App\Http\Controllers\PointController::class, 'status']);
});
//造车
Route::prefix('equipRecordCar')->group(function () {
    Route::get('/', [\App\Http\Controllers\EquipRecordCarController::class, 'index']);
    Route::get('/getAll', [\App\Http\Controllers\EquipRecordCarController::class, 'getAll']);
    Route::get('/getlist', [\App\Http\Controllers\EquipRecordCarController::class, 'getlist']);
    Route::post('/create', [\App\Http\Controllers\EquipRecordCarController::class, 'create']);
    Route::delete('/delete', [\App\Http\Controllers\EquipRecordCarController::class, 'delete']);
    Route::put('/update', [\App\Http\Controllers\EquipRecordCarController::class, 'update']);
    Route::get('/info', [\App\Http\Controllers\EquipRecordCarController::class, 'info']);
    Route::get('/lastinfo', [\App\Http\Controllers\EquipRecordCarController::class, 'lastinfo']);
    Route::put('/status', [\App\Http\Controllers\EquipRecordCarController::class, 'status']);
});
//角色管理
Route::prefix('upload')->group(function () {
    Route::get('/', function (){
        dump(phpinfo());
    });
    Route::post('/uploadimg', [\App\Http\Controllers\UploadController::class, 'uploadimg']);
});


